#!/bin/sh

yum install -y python-setuptools 
easy_install pip
pip install shadowsocks
touch /etc/shadowsocks.json
echo '{' >> /etc/shadowsocks.json
echo ' "server":"0.0.0.0",' >> /etc/shadowsocks.json
echo ' "port_password": {' >> /etc/shadowsocks.json
echo '   "8080": "$xty0430"' >> /etc/shadowsocks.json
echo ' },' >> /etc/shadowsocks.json
echo ' "local_port": 1080,' >> /etc/shadowsocks.json
echo ' "timeout": 600,' >> /etc/shadowsocks.json
echo ' "method": "aes-256-cfb"' >> /etc/shadowsocks.json
echo '}' >> /etc/shadowsocks.json
ssserver -c /etc/shadowsocks.json -d start
chmod a+x /etc/rc.local
echo 'ssserver -c /etc/shadowsocks.json -d start' >> /etc/rc.local
echo ''
echo '============'
echo 'The config file is at /etc/shadowsocks.json'
echo 'your default account: '
echo 'local_port:1080'
echo 'server_port:8080'
echo 'method:aes-256-cfb'